package org.springblade.mes.logistics.inventory.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 库存信息
 * @author 翁金川
 * @since 2025-06-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("lgs_inventory")
@ApiModel(value = "Inventory对象", description = "库存信息")
public class Inventory extends TenantEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 库位id
     */
    @ApiModelProperty(value = "库位id")
    private Long locId;

    /**
     * 库区id
     */
    @ApiModelProperty(value = "库区id")
    private Long areaId;

    /**
     * 子单物料项id 入库明细、出库明细、调拨明细
     */
    @ApiModelProperty(value = "子单物料项id 入库明细、出库明细、调拨明细")
    private Long itemId;

    /**
     * 标箱编号
     */
    @ApiModelProperty(value = "标箱编号")
    private String boxCode;

    /**
     * 标箱数量
     */
    @ApiModelProperty(value = "标箱数量")
    private Integer boxCounts;

    private BigDecimal realCounts;

    /**
     * 盘点数量
     */
    @ApiModelProperty(value = "盘点数量")
    private Integer takeCounts;

    /**
     * 物料编码
     */
    @ApiModelProperty(value = "物料编码")
    private Long materialId;

    /**
     * 锁定来源
     */
    @ApiModelProperty(value = "锁定来源")
    private Integer lockSource;

    /**
     * 1:锁定 0:未锁定
     */
    @ApiModelProperty(value = "1:锁定 0:未锁定")
    private Integer lockFlag;

    /**
     * 锁定备注
     */
    @ApiModelProperty(value = "锁定备注")
    private String lockRemark;

    /**
     * 是否已盘点 1：是 0：否
     */
    @ApiModelProperty(value = "是否已盘点 1：是 0：否")
    private Integer takeFlag;

    /**
     * 库存周期, 0:发货在途 1:等待上架 2:正常上架 3:等待下架 4:出库完成 5:来料退回
     */
    @ApiModelProperty(value = "库存周期, 0:发货在途 1:等待上架 2:正常上架 3:等待下架 4:出库完成 5:来料退回")
    private Integer inventoryType;

    /**
     * 1：合格0：不合格
     */
    @ApiModelProperty(value = "1：合格0：不合格")
    private Integer qualityStatus;

    /**
     * 生产批次
     */
    @ApiModelProperty(value = "生产批次")
    private String productBatch;

    /**
     * 生产日期
     */
    @ApiModelProperty(value = "生产日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime productDate;

    /**
     * 初始入库类型
     */
    @ApiModelProperty(value = "初始入库类型")
    private String inputInitType;

    /**
     * 入库类型
     */
    @ApiModelProperty(value = "入库类型")
    private String inputType;

    /**
     * 入库时间
     */
    @ApiModelProperty(value = "入库时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime inputTime;

    /**
     * 入库人员
     */
    @ApiModelProperty(value = "入库人员")
    private Long inputUser;

    /**
     * 失效日期
     */
    @ApiModelProperty(value = "失效日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private LocalDate expiryDate;

    /**
     * 入库单Id
     */
    @ApiModelProperty(value = "入库单Id")
    private Long entryId;

    /**
     * 入库单物料明细Id
     */
    @ApiModelProperty(value = "入库单物料明细Id")
    private Long entryDetailId;

    private String remark;

    /**
     * 装箱数量
     */
    @ApiModelProperty(value = "装箱数量")
    private Integer putNum;

    /**
     * 通知明细Id
     */
    @ApiModelProperty(value = "通知明细Id")
    private Long adviceDetailId;

    /**
     * 是否清点过,1为清点过
     */
    @ApiModelProperty(value = "是否清点过,1为清点过")
    private Integer isChecked;

    /**
     * 是否提交质检,1为提交过
     */
    @ApiModelProperty(value = "是否提交质检,1为提交过")
    private Integer isSubmitedInspection;

    /**
     * 原始质检状态,默认合格
     */
    @ApiModelProperty(value = "原始质检状态,默认合格")
    private String originalQualityStatus;

    /**
     * 检后状态,合格/不合格
     */
    @ApiModelProperty(value = "检后状态,合格/不合格")
    private String currentQualityStatus;

    /**
     * 计划单号
     */
    @ApiModelProperty(value = "计划单号")
    private String planNo;

    /**
     * 发货单号,备用
     */
    @ApiModelProperty(value = "发货单号,备用")
    private String sendNo;

    /**
     * 清点单号
     */
    @ApiModelProperty(value = "清点单号")
    private String checkNo;

    /**
     * 质检单号
     */
    @ApiModelProperty(value = "质检单号")
    private String inspectionNo;

    /**
     * 入库单号
     */
    @ApiModelProperty(value = "入库单号")
    private String entryNo;

    /**
     * 退货单号
     */
    @ApiModelProperty(value = "退货单号")
    private String returnNo;

    /**
     * 是否已提交到入库单0,1
     */
    @ApiModelProperty(value = "是否已提交到入库单0,1")
    private Integer isSubmitedEntry;

    /**
     * 是否已提交到库存0,1
     */
    @ApiModelProperty(value = "是否已提交到库存0,1")
    private Integer isSubmitedInventory;

    /**
     * 上架用户名
     */
    @ApiModelProperty(value = "上架用户名")
    private String upUserName;

    /**
     * 退货单明细Id
     */
    @ApiModelProperty(value = "退货单明细Id")
    private Long returnDetailId;

    /**
     * 质检单明细Id
     */
    @ApiModelProperty(value = "质检单明细Id")
    private Long inspectionDetailId;

    /**
     * 物料编码
     */
    @ApiModelProperty(value = "物料编码")
    private String materialCode;

    /**
     * 库存周期:发货在途,等待上架,正常在库,等待拣选,出库完成
     */
    @ApiModelProperty(value = "库存周期:发货在途,等待上架,正常在库,等待拣选,出库完成")
    private String inventoryStatus;

    /**
     * 库位编码
     */
    @ApiModelProperty(value = "库位编码")
    private String locCode;

    private String unit;

    /**
     * 生产任务号
     */
    @ApiModelProperty(value = "生产任务号")
    private String productionTaskNo;

    /**
     * 炉号
     */
    @ApiModelProperty(value = "炉号")
    private String furnaceNo;

    /**
     * 托单号
     */
    @ApiModelProperty(value = "托单号")
    private String palletNo;

    /**
     * 外部标签编码
     */
    @ApiModelProperty(value = "外部标签编码")
    private String externalCode;

    /**
     * 净重
     */
    @ApiModelProperty(value = "净重")
    private BigDecimal netWeight;

    /**
     * 供应商id
     */
    @ApiModelProperty(value = "供应商id")
    private Long supplierId;

    /**
     * 是否已称重,0未,1已称
     */
    @ApiModelProperty(value = "是否已称重,0未,1已称")
    private Integer weighed;

    /**
     * 原料生产批次
     */
    @ApiModelProperty(value = "原料生产批次")
    private String productBatchSrc;

    /**
     * 可进行登记,0:否,1:是
     */
    @ApiModelProperty(value = "可进行登记,0:否,1:是")
    private Integer canRegister;

    /**
     * 是否为三方库库存,0否,默认,1:是,
     */
    @ApiModelProperty(value = "是否为三方库库存,0否,默认,1:是,")
    private Integer isThird;

    /**
     * 预计到达日期
     */
    @ApiModelProperty(value = "预计到达日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime planArrivalDate;

    /**
     * 最终产品名称
     */
    @ApiModelProperty(value = "最终产品名称")
    private String finalProductName;

    /**
     * 供应商生产批次
     */
    @ApiModelProperty(value = "供应商生产批次")
    private String productBatchSupplier;

    /**
     * 到达日期
     */
    @ApiModelProperty(value = "到达日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime arrivalDate;

    /**
     * 销售订单号
     */
    @ApiModelProperty(value = "销售订单号")
    private String sellOrderNo;

    /**
     * 原始装箱数量
     */
    @ApiModelProperty(value = "原始装箱数量")
    private BigDecimal originalQuantity;

    /**
     * 生产订单号(生产批次号),合并备料出库时有多个用逗号分开
     */
    @ApiModelProperty(value = "生产订单号(生产批次号),合并备料出库时有多个用逗号分开")
    private String productOrderNos;

    /**
     * 最初来源入库单号
     */
    @ApiModelProperty(value = "最初来源入库单号")
    private String srcEntryNo;

    /**
     * 首次入库时间
     */
    @ApiModelProperty(value = "首次入库时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime firstEntryTime;

    /**
     * 尺寸
     */
    @ApiModelProperty(value = "尺寸")
    private String size;

    /**
     * 销售合同号
     */
    @ApiModelProperty(value = "销售合同号")
    private String sellContractNo;

    /**
     * 客户名称
     */
    @ApiModelProperty(value = "客户名称")
    private String customerName;


}
